using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Callista.TFSBuildAlert
{
    public partial class SettingsForm : Form
    {
        public SettingsForm()
        {
            InitializeComponent();
        }

        private void SettingsForm_Load(object sender, EventArgs e)
        {
            TFSTextBox.Text = Settings.TFSServer;
            AlertTextBox.Text = Settings.AlertCommand;
            ResetTextBox.Text = Settings.ResetCommand;
        }

        private void AlertButton_Click(object sender, EventArgs e)
        {
            Program.Current.Alert(AlertTextBox.Text);
        }

        private void ResetButton_Click(object sender, EventArgs e)
        {
            Program.Current.Reset(ResetTextBox.Text);
        }

        private void OkButton_Click(object sender, EventArgs e)
        {
            Settings.TFSServer = TFSTextBox.Text;
            Settings.AlertCommand = AlertTextBox.Text;
            Settings.ResetCommand = ResetTextBox.Text;
            this.DialogResult = DialogResult.OK;
        }
    }
}